[IA64] vti fault handler clean up: improve the VTi domain fault handler
authorAlex Williamson <alex.williamson@hp.com>
Fri, 14 Dec 2007 20:37:57 +0000 (13:37 -0700)
committerAlex Williamson <alex.williamson@hp.com>
Fri, 14 Dec 2007 20:37:57 +0000 (13:37 -0700)
Improve the VTi domain fault handler panic path.  Currently when a
VTi fault handler finds something wrong, it enters an infinite loop
in vmx_panic with interrupts masked.  It makes sense if hw-based
debugger is available.  However in most cases this isn't available,
especially for normal users.  This patch makes those panic paths
more user friendly by printing out the panic message.  The old
behaviour is left with vmx_panic configuration.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/Rules.mk
xen/arch/ia64/vmx/vmx_ivt.S
xen/arch/ia64/vmx/vmx_minstate.h

index 860435b2a44bfe6021b2b1e8416ed6dca62b5066..92a200b043a0cb5c13dc5079d28d503501e4bb74 100644 (file)
@@ -7,6 +7,7 @@ HAS_VGA  := y
 xenoprof := y
 no_warns ?= n
 vti_debug ?= n
+vmx_panic ?= n
 xen_ia64_expose_p2m    ?= y
 xen_ia64_pervcpu_vhpt  ?= y
 xen_ia64_tlb_track     ?= y
@@ -40,6 +41,9 @@ CFLAGS        += -g
 ifeq ($(vti_debug),y)
 CFLAGS  += -DVTI_DEBUG
 endif
+ifeq ($(vmx_panic),y)
+CFLAGS  += -DCONFIG_VMX_PANIC
+endif
 ifeq ($(xen_ia64_expose_p2m),y)
 CFLAGS += -DCONFIG_XEN_IA64_EXPOSE_P2M
 endif
index c908ce15119de177d92c2eb7138abbea76114287..e86996f85430ebd52f9a17e022e2b78879ad3a51 100644 (file)
@@ -119,11 +119,12 @@ vmx_fault_##n:;                                 \
 (p7)br.sptk.many vmx_dispatch_reflection;           \
     br.sptk.many dispatch_to_fault_handler
 
+#ifdef CONFIG_VMX_PANIC
 GLOBAL_ENTRY(vmx_panic)
     br.sptk.many vmx_panic
     ;;
 END(vmx_panic)
-
+#endif
 
 
 
@@ -1353,6 +1354,7 @@ ENTRY(vmx_dispatch_reflection)
     VMX_SAVE_REST
     mov rp=r14
     ;;
+    P6_BR_CALL_PANIC(.Lvmx_dispatch_reflection_string)
     adds out4=16,r12
     br.call.sptk.many b6=vmx_reflect_interruption
 END(vmx_dispatch_reflection)
@@ -1375,6 +1377,7 @@ ENTRY(vmx_dispatch_virtualization_fault)
     VMX_SAVE_EXTRA
     mov rp=r14
     ;;
+    P6_BR_CALL_PANIC(.Lvmx_dispatch_virtualization_fault_string)
     adds out1=16,sp         //regs
     br.call.sptk.many b6=vmx_emulate
 END(vmx_dispatch_virtualization_fault)
@@ -1396,6 +1399,7 @@ GLOBAL_ENTRY(vmx_dispatch_vexirq)
     movl r14=ia64_leave_hypervisor
     ;;
     mov rp=r14
+    P6_BR_CALL_PANIC(.Lvmx_dispatch_vexirq_string)
     br.call.sptk.many b6=vmx_vexirq
 END(vmx_dispatch_vexirq)
 
@@ -1416,6 +1420,7 @@ ENTRY(vmx_dispatch_tlb_miss)
     VMX_SAVE_REST
     mov rp=r14
     ;;
+    P6_BR_CALL_PANIC(.Lvmx_dispatch_tlb_miss_string)
     adds out2=16,r12
     br.call.sptk.many b6=vmx_hpw_miss
 END(vmx_dispatch_tlb_miss)
@@ -1439,6 +1444,7 @@ ENTRY(vmx_dispatch_break_fault)
     VMX_SAVE_REST
     mov rp=r14
     ;;
+    P6_BR_CALL_PANIC(.Lvmx_dispatch_break_fault_string)
     adds out1=16,sp
     br.call.sptk.many b6=vmx_ia64_handle_break
     ;;
@@ -1463,3 +1469,14 @@ ENTRY(vmx_dispatch_interrupt)
     add out1=16,sp             // pass pointer to pt_regs as second arg
     br.call.sptk.many b6=ia64_handle_irq
 END(vmx_dispatch_interrupt)
+
+.Lvmx_dispatch_reflection_string:
+    .asciz "vmx_dispatch_reflection\n"
+.Lvmx_dispatch_virtualization_fault_string:
+    .asciz "vmx_dispatch_virtualization_fault\n"
+.Lvmx_dispatch_vexirq_string:
+    .asciz "vmx_dispatch_vexirq\n"
+.Lvmx_dispatch_tlb_miss_string:
+    .asciz "vmx_dispatch_tlb_miss\n"
+.Lvmx_dispatch_break_fault_string:
+    .asciz "vmx_dispatch_break_fault\n"
index 76a52192a85d228034ae296502403b38c046ba61..9706b03a646445c6f115cde5e58a9ffc2c6e00ea 100644 (file)
  *  r11 = FPSR_DEFAULT
  *  r12 = kernel sp (kernel virtual address)
  *  r13 = points to current task_struct (kernel virtual address)
+ *   p6 = (psr.vm || isr.ni)
+ *        panic if not external interrupt (fault in xen VMM)
  *  p15 = TRUE if psr.i is set in cr.ipsr
  *  predicate registers (other than p2, p3, and p15), b6, r3, r14, r15:
  *      preserved
  * we can pass interruption state as arguments to a handler.
  */
 
+#ifdef CONFIG_VMX_PANIC
+# define P6_BR_VMX_PANIC        (p6)br.spnt.few vmx_panic;
+#else
+# define P6_BR_VMX_PANIC        /* nothing */
+#endif
+
+#define P6_BR_CALL_PANIC(panic_string)  \
+(p6) movl out0=panic_string;            \
+(p6) br.call.spnt.few b6=panic;
+
 #define VMX_DO_SAVE_MIN(COVER,SAVE_IFS,EXTRA)                                           \
     mov r27=ar.rsc;                     /* M */                                         \
     mov r20=r1;                         /* A */                                         \
     ;;                                                                                  \
 (pUStk) tbit.nz.and p6,p0=r18,IA64_ISR_NI_BIT;                                          \
     ;;                                                                                  \
-(p6)br.spnt.few vmx_panic;                                                              \
+    P6_BR_VMX_PANIC                                                                     \
 (pUStk)VMX_MINSTATE_GET_CURRENT(r1);                                                    \
     /*    mov r21=r16;  */                                                              \
     /* switch from user to kernel RBS: */                                               \